package edu.cs346.group5.ui.forumpages;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import net.miginfocom.swing.MigLayout;
import javax.swing.JButton;

import edu.cs346.group5.ui.MenuFactory;
import edu.cs346.group5.ui.userpages.search_user;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

public class search extends JFrame {

	private JPanel contentPane;

	/**
	 * Launch the application.
	 */
	

	/**
	 * Create the frame.
	 */
	public search() {
		setTitle("Search");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 450, 300);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(new MigLayout("", "[][][][][][][]", "[][][][][][]"));
		
		JButton btnSearchUser = new JButton("Search User");
		btnSearchUser.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				search_user x = new search_user();
				x.setVisible(true);
				dispose();
			}
		});
		contentPane.add(btnSearchUser, "cell 6 3");
		
		setJMenuBar(MenuFactory.getMenu(this));
		
		JButton btnSearchTopic = new JButton("Search Topic");
		btnSearchTopic.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				search_topic x = new search_topic();
				x.setVisible(true);
				dispose();
			}
		});
		contentPane.add(btnSearchTopic, "cell 6 5");
	}

}
